import request from '@/router/axios';
const prefix = '/api/dolphinscheduler';
export const getDataLayerList = (params) => {
  return request({
    url: prefix + `/dolphinscheduler/datahierarchy/list-paging`,
    method: 'get',
    params
  })
};
export const saveDataLayer = (params) => {
  return request({
    url: prefix + `/dolphinscheduler/datahierarchy/create`,
    method: 'post',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    transformRequest: [data => {
      let formData = new FormData();
      for(let key in data){
        formData.append(key, data[key])
      }
      return formData
    }],
    data:params
  })
};
export const updateDataLayer = (params) => {
  return request({
    url: prefix + `/dolphinscheduler/datahierarchy/update`,
    method: 'post',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    transformRequest: [data => {
      let formData = new FormData();
      for(let key in data){
        formData.append(key, data[key])
      }
      return formData
    }],
    data:params
  })
};
export const delDataLayer = (params) => {
  return request({
    url: prefix + `/dolphinscheduler/datahierarchy/delete`,
    method: 'get',
    params
  })
};
export const updateEnableStatus = (params) => {
  return request({
    url: prefix + `/dolphinscheduler/datahierarchy/updateDataHierarchyEnableStatus`,
    method: 'post',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    transformRequest: [data => {
      let formData = new FormData();
      for(let key in data){
        formData.append(key, data[key])
      }
      return formData
    }],
    data:params
  })
};
export const updateShowStatus = (params) => {
  return request({
    url: prefix + `/dolphinscheduler/datahierarchy/updateDataHierarchyShowStatus`,
    method: 'post',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    transformRequest: [data => {
      let formData = new FormData();
      for(let key in data){
        formData.append(key, data[key])
      }
      return formData
    }],
    data:params
  })
};
export const queryTablesByDataBaseIdAndDhId = (params) => {
  return request({
    url: prefix + `/dolphinscheduler/datahierarchy/queryTablesByDataBaseIdAndDhId`,
    method: 'post',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    transformRequest: [data => {
      let formData = new FormData();
      for(let key in data){
        formData.append(key, data[key])
      }
      return formData
    }],
    data:params
  })
};
export const queryDataBaseByDataHierarchyId = (params) => {
  return request({
    url: prefix + `/dolphinscheduler/datahierarchy/queryDataBaseByDataHierarchyId`,
    method: 'post',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    transformRequest: [data => {
      let formData = new FormData();
      for(let key in data){
        formData.append(key, data[key])
      }
      return formData
    }],
    data:params
  })
};
